package mytest.ssw.www.core;

import android.content.Context;
import android.util.Log;

import java.util.List;

import mytest.ssw.www.api.DeptNodeFoundation;
import mytest.ssw.www.api.DeptNodeFoundationImpl;
import mytest.ssw.www.mylibrary.DeptNode;

/**
 * Created by hasee on 2016/5/2.
 */
public class DeptNodeCoreImpl implements DeptNodeCore {
    DeptNodeFoundation dnf;
     String fileDir;
    private Context context;

    public DeptNodeCoreImpl(Context context) {
        this.context = context;
        this.fileDir=context.getFilesDir().toString();
    }
    @Override
    public  List<DeptNode> getByPNum(final String pNum) {
        Log.i("pnum",pNum);
        dnf = new DeptNodeFoundationImpl(fileDir);
        return dnf.getLocalByPNum(pNum);
    }

    public List<DeptNode> getAll(){
        dnf = new DeptNodeFoundationImpl(fileDir);
        return dnf.getAllLocal();
    }
    public List<DeptNode> getBylevel(int level){
        dnf = new DeptNodeFoundationImpl(fileDir);
        return dnf.getAllLocalByLevel(level);
    }
}
